Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preserve stop times flag to avoid normalizing stop_sequence #304

Merged
merged 5 commits into from
May 19, 2020

Conversation

landonreed
Copy link
Contributor

@landonreed landonreed commented Apr 23, 2020

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JavaDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

This PR adds a FeedSource#preserveStopTimes flag to avoid the stop_sequence normalization that typically happens when making a snapshot for the editor.

re conveyal/gtfs-lib#283.

Note: needs pom.xml updated to [email protected] in order for build to pass (conveyal/gtfs-lib#285 needs to be merged and released first).

Note: there is no corresponding datatools-ui PR to set this flag (primarily just so that users don't "try this at home"). It must be done with a MongoDB update statement like:

db.getCollection('FeedSource').update({"_id": "YOUR_TEST_FEED_ID"}, {"preserveStopTimes": true})

@landonreed landonreed changed the title improvement(snapshots): add preserve stop times flag to avoid normalizing stop_sequence Add preserve stop times flag to avoid normalizing stop_sequence Apr 23, 2020
* stop_times or individual patterns. WARNING: enabling this flag for a feed and then attempting to edit patterns in
* complicated ways (e.g., modifying the order of pattern stops) could have unexpected consequences.
*/
public boolean preserveStopTimes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to preserveStopTimesSequence and simplify the comment above.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@landonreed
Copy link
Contributor Author

OK, just waiting on the gtfs-lib release. I'll merge this once I've updated the pom.

brings in preserveStopTimes flag for snapshotting
* zero-based and incrementing. This can muck with GTFS files that are linked to GTFS-rt feeds by stop_sequence, so
* this override flag currently provides a workaround for feeds that need to be edited but do not need to edit
* stop_times or individual patterns. WARNING: enabling this flag for a feed and then attempting to edit patterns in
* complicated ways (e.g., modifying the order of pattern stops) could have unexpected consequences.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it'd be good to have some kind of UI warning for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, just read the PR description. Maybe edit this comment to say that there is no UI setting for this and it is not recommended to do this unless absolutely necessary.

@evansiroky evansiroky removed their assignment Apr 29, 2020
@landonreed landonreed merged commit 5499fc4 into dev May 19, 2020
@landonreed landonreed deleted the preserve-stop-times branch May 19, 2020 17:57
@landonreed
Copy link
Contributor Author

🎉 This PR is included in version 3.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants